﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.Composite.Modularity;
using Microsoft.Practices.Unity;
using System.Configuration;
using Microsoft.Practices.Unity.Configuration;

namespace Skynet.Administracion
{
    public class ModuleIni : IModule
    {

        [Dependency]
        public IUnityContainer ContainerService { get; set; }
        public void Initialize()
        {
            var fileMapPolicies = new ExeConfigurationFileMap { ExeConfigFilename = @".\Modules\Administracion.config" };
            var configurationPolicies = ConfigurationManager.OpenMappedExeConfiguration(fileMapPolicies, ConfigurationUserLevel.None);
            var unitySectionPolicies = (UnityConfigurationSection)configurationPolicies.GetSection("unity");
            this.ContainerService.LoadConfiguration(unitySectionPolicies);


           
        }        
    }
}
